#include "_AFXWIN.H"

int __stdcall WinMain(HINSTANCE hInstance,HINSTANCE hPreInstance,LPSTR lpCmdLine,int nCmdShow)
{
	if (hPreInstance!=NULL)
	{
		_asm{int 3}
	}

	int nReturnCode = -1;
	CWinThread* pThread = AfxGetThread();
	CWinApp* pApp = AfxGetApp();
	if (!AfxWinInit(hInstance,hPreInstance,lpCmdLine,nCmdShow))
	{
		goto InitFailure;
	}

	if(pApp!=NULL && !pApp->InitApplication())
	{
		goto InitFailure;
	}

	if(!pThread->InitInstance())
	{
		nReturnCode = pThread->ExitInstance();
		goto InitFailure;
	}

	nReturnCode = pThread->Run();
InitFailure:
	return nReturnCode;
}